<template>
    <el-card>
        <!-- <vue3-tinymce v-model="msg" script-src="/tinymce/tinymce.min.js" :setting="state.setting" /> -->
    </el-card>
</template>

<script lang="ts" setup>
// import { useStore } from "vuex";
// import Vue3Tinymce from 'vue3-tinymce';
import { ref,reactive,computed,watch } from 'vue';
// const store = useStore();
// 设置默认信息
// const isDark= computed(() => {
//     return store.state.setting.isDark;
// })

const msg = ref();
// const action = ref(process.env.VUE_APP_BASE_URL + '/admin/api/v1/upload/picture');
const action = ref('http://www.shopphp.net:8090/index.php/admin/api/v1/upload/picture');
const state = reactive({
  setting: {
    height: 800,
    toolbar: 'undo redo | fullscreen | blocks alignleft aligncenter alignright alignjustify | link unlink | numlist bullist | image media table | fontsize forecolor backcolor | bold italic underline strikethrough | indent outdent | superscript subscript | removeformat |',
    toolbar_mode: 'sliding',
    quickbars_selection_toolbar: 'removeformat | bold italic underline strikethrough | fontsize forecolor backcolor',
    plugins: 'link image media table lists fullscreen quickbars',
    font_size_formats: '12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px', // 字体大小
    line_height_formats: '12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px',
    link_default_target: '_blank',
    link_title: false,
    nonbreaking_force_tab: true,
    language: 'zh-Hans',
    language_url: '/tinymce/langs/zh-Hans.js',
    content_style: 'body{font-size: 16px}',
    // 自定义 图片上传模式
    custom_images_upload: true,
    images_upload_url: action,
    content_css:  "/tinymce/skins/content/default/content.css",
    custom_images_upload_header:{'Access-Token':""},
    custom_images_upload_callback: (res:any) => {
        console.info(res);
        return res.data.url;
    },
    custom_images_upload_param: { id: '' },
  }
});

</script>